Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

fix: support custom/third-party model paths in Vertex AI provider - #12078

Draft
ghost wants to merge 1 commit into
mainfrom
feature/vertex-custom-model-paths
Draft

fix: support custom/third-party model paths in Vertex AI provider#12078
ghost wants to merge 1 commit into
mainfrom
feature/vertex-custom-model-paths

Conversation

@ghost

@ghost ghost commented Apr 8, 2026

Copy link
Copy Markdown

Related GitHub Issue

Closes: #12074

Description

This PR attempts to address Issue #12074. Feedback and guidance are welcome.

Problem: When using the GCP Vertex AI provider with third-party MaaS models (e.g. gpt-oss-120b-maas, qwen, kimi-k2), the extension would silently fall back to the default model ID because the user-provided model was not in the known vertexModels map. This caused the SDK to construct a path like publishers/google/models/<default-model> instead of using the intended model.

Fix: Modified VertexHandler.getModel() to handle three cases:

  1. Known model (in vertexModels map): use curated ModelInfo as before
  2. Custom/unknown model: pass through the user-provided model ID as-is with sensible default ModelInfo. This supports both bare model names (gpt-oss-120b-maas) and fully-qualified publisher paths (publishers/openai/models/gpt-oss-120b-maas)
  3. No model specified: fall back to the default (existing behavior)

Test Procedure

  • Added 4 new test cases in vertex.spec.ts:
    • Custom model IDs pass through instead of falling back to default
    • Publisher-qualified paths (e.g. publishers/openai/models/...) pass through as-is
    • Tool preferences (edit/apply_diff) still apply to custom models
    • No model specified still falls back to default
  • All 11 tests pass: cd src && npx vitest run api/providers/__tests__/vertex.spec.ts

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue.
  • Scope: Changes are focused on the linked issue.
  • Self-Review: Self-reviewed.
  • Testing: New tests added covering custom model paths.
  • Documentation Impact: No documentation updates required.
  • Contribution Guidelines: Read and agreed.

Documentation Updates

  • No documentation updates are required.

Additional Notes

The @google/genai SDK and Vertex AI API accept full resource names directly, so passing publishers/openai/models/gpt-oss-120b-maas as the model ID should route correctly to the third-party publisher endpoint.

Interactively review PR in Roo Code Cloud

When users specify a custom or third-party MaaS model ID (e.g.
"gpt-oss-120b-maas" or "publishers/openai/models/gpt-oss-120b-maas"),
the VertexHandler now passes it through as-is instead of silently
falling back to the default model. This fixes 404 NOT_FOUND errors
when using non-Google models on Vertex AI.

Closes #12074
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] API provider setting / GCP vertex AI

1 participant